#ifndef POINT_H
#define POINT_H

#include <QColor>
#include "Element.h"

class QPainter;
class Cell;
class Line;

class Dot : public QPoint, public Element
{
public:
    Dot(QPoint pt,unsigned int nEdge,uint nRow,uint nCol);
    unsigned int totalEdge();
    bool nearToMe(QPoint pos);
    unsigned int increase();
    uint decrease();
    bool isSelectable();
    uint row();
    uint column();

    void draw(QPainter *pDC);
    void drawEllipse(QPainter *pDC,uint nRadius,QColor color);
    QPoint point();
    bool isSame(Element *pElem, bool bByValue = true);
    bool isSame(QPoint pos);

    bool containerCellExist(Cell *pCell);
    bool containerLineExist(Line *pLine);

private:
    bool addContainerCell(Cell *pCell);
    bool addContainerLine(Line *pLine);
    bool removeContainerCell(Cell *pCell);
    bool removeContainerLine(Line *pLine);

private:
    uint mnTotalEdge,mnEdgeCount;
    uint mnRow,mnCol;
    QList<Cell*> mContainerCells;
    QList<Line*> mContainerLines;

    friend class Line;
};

#endif // POINT_H
